package com.danbay.cloud.device.api.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author yangyanchen on 2018/1/15
 *         Copyright © 2016 －2017 旦倍科技
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ResponseObject {

    private String status ;

    private String message ;

    private Object result ;

    public void setCodeMessage(ResultEnum errCodeEnum)
    {
        int code = errCodeEnum.getCode();
        setStatus(code+"");
        setMessage(errCodeEnum.getMessage());
        if(code!= ResultEnum.SUCCESS.getCode())
        {
            setResult(false);
        }else
        {
            setResult(true);
        }

    }
}

